
#include "Container.h"

void Container::addEntity(Entity* _entity)
{
    m_entities.push_back(_entity);
}

void Container::clear()
{
    m_entities.clear();
}

void Container::update()
{
    for (int i=0; i<m_entities.size(); i++) {
        m_entities.at(i)->update();
    }
}

void Container::render(Vector2 _vOffset)
{
    Vector2 vPos = getPosition() + _vOffset;
    for (int i=0; i<m_entities.size(); i++) {
        Entity* ent = m_entities.at(i);
        ent->render(vPos);
    }
}

void Container::render()
{
    render(Vector2(0.0f, 0.0f));
}
